<%@ page import="java.util.*" %>
<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2023/10/6
  Time: 9:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>pageContext作用域</title>
</head>
<body>
    <%
        //1. 定义图书列表

        //2. 将图书列表放到pageContext作用域中
        // pageContext：作用域：只在当前页面有效，出了页面就取不到值！（实际开发中使用很少）
        pageContext.setAttribute("book","《三国演义》");
        Object book = pageContext.getAttribute("book");
        out.println("在当前页面取值：" + book);
        //3. 进行页面跳转 (转发)
        request.getRequestDispatcher("/listbooks.jsp").forward(request,response);
    %>
</body>
</html>
